<?php
/** 
 * Plugin 'rdt_text' for the 'ameos_formidable' extension.
 *
 * @author	Jerome Schneider <typo3dev@ameos.com>
 */


class tx_rdttext extends formidable_mainrenderlet {
	
	function _render() {

		$this->skin_init("active");

		$sValue = $this->getValue();

		$aSkin = $this->skin_apply(
			array(
				"label"		=> $this->getLabel(),
				"name"		=> $this->_getElementHtmlName(),
				"id"		=> $this->_getElementHtmlId(),
				"value"		=> htmlspecialchars($sValue),
				"value."	=> array(
					"nl2br" => nl2br(htmlspecialchars($sValue)),
					"raw"	=> $sValue,
				),
				"addparams"	=> $this->_getAddInputParams(),
			),
			array(
				"input" => '<input type="text" name="{name}" id="{id}" value="{value}" {addparams} />',
				"__compiled" => $this->_displayLabel("{label}") . "{input}",
			)
		);

		return $aSkin;
	}
}


	if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/ameos_formidable/api/base/rdt_text/api/class.tx_rdttext.php"])	{
		include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/ameos_formidable/api/base/rdt_text/api/class.tx_rdttext.php"]);
	}
?>